package com.foreknow.eldclient.controller;

import com.foreknow.eldclient.po.User;
import com.foreknow.eldclient.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
@ResponseBody
@RequestMapping("UserController")
public class UserController {
    @Autowired
    UserService US;
    @RequestMapping("/getUserByIdByPass")
    public User getUserByIdByPass(String userId, String password) throws Exception{
        return US.getUserByIdByPass(userId,password);

    }

    @RequestMapping("/getUserById")
    public int getUserById(String userId) throws Exception{
        return US.getUserById(userId);
    }

    @RequestMapping("/saveUser")
    public int saveUser(User user) throws Exception{
        return US.saveUser(user);
    }

    @RequestMapping("/getUserImg")
    public String getUserImg(String userId) {
        return US.getUserImg(userId);
    }

    @RequestMapping("/updateUser")
    public int updateUser(User user) {
        return US.updateUser(user);
    }
}
